import 'package:flutter/material.dart';
import 'package:flutter_weather_bg/bg/weather_bg.dart';
import 'package:flutter_weather_bg/utils/WeatherUtil.dart';

class ListItemWidget extends StatelessWidget {
  final WeatherType weatherType;
  final int flage ;

  ListItemWidget( {Key key, this.weatherType ,this.flage} ) : super(key: key);

  @override
  Widget build(BuildContext context) {



    var itemView =ClipPath(
      child: Stack(
        children: [
          WeatherBg(
            weatherType: weatherType,
            width: MediaQuery.of(context).size.width,
            height: 60,
          ),
          
          Container(
            color: Colors.transparent,
            padding:EdgeInsets.only( left: 10),
            alignment: Alignment.centerLeft ,//Alignment(0, 0),
            height: 60,
            child: Text(
              "${flage+1}、${WeatherUtil.getWeatherDesc(weatherType)}"  ,
              style: TextStyle(
                  color: Colors.white,
                  fontSize: 20,
                  fontStyle: FontStyle.italic,  // 斜体
                  fontWeight: FontWeight.normal),
            ),
          ) ,
        ],
      ),

      clipper: ShapeBorderClipper(
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.circular(20)))),
    ) ;

    var itemView1 = Padding(
      padding: EdgeInsets.only(left: 10 ,right: 10),
      child: itemView,
    );
    return itemView1;
  }
}
